<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue中使用animate.css库</title>
    <script src="js/vue.js"></script>
    <link
            rel="stylesheet"
            href="https://unpkg.com/animate.css@3.5.2/animate.min.css"/>
    <style>
        .v-enter,.v-leave-to{
            opacity: 0;
        }
        .v-enter-active,.v-leave-active{
            transition: opacity 1s;
        }
    </style>
</head>
<body>
<div id="root">
    <transition
            :duration="{enter:5000,leave:10000}"
            type="transition"
            appear
            enter-active-class="animated swing v-enter-active"
            leave-active-class="animated shake v-leave-active"
            appear-active-class="animated swing"
    >
        <div v-if="show">hello world</div>
    </transition>

    <button @click="handleClick">toggle</button>
</div>
<script>
    var vm = new Vue({
        el: "#root",
        data: {
            show: true
        },
        methods: {
            handleClick: function () {
                this.show = !this.show
            }
        }
    })
</script>
</body>
</html>